package com.sbp.message.service;

import com.dap.api.ISunriseCommonServiceProxy;
import com.dap.param.CommonServiceContext;
import com.dap.param.StringInput;
import com.dap.utils.TraceIdUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by wangmin on 2020/4/20.
 */
@Service
public class SmsServiceInvoker {
    @Resource(name="smsServiceProxy")
    protected ISunriseCommonServiceProxy serviceProxy;

    public Object invoke(String group, StringInput stringInput) {
        Map<String, Object> context = new HashMap<>();
        context.put("traceId", TraceIdUtils.generateTraceId(false));
        context.put("isFrontRequest", CommonServiceContext.getIsFrontRequest());

        return serviceProxy.executeSunriseServiceObject(context, group, stringInput);
    }
}
